{
  interface Person {
    name: string;
    age: number;
  }

  let tom: Person = {
    name: "Tom",
    age: 25, // comment this line
    // gender: "male", // uncomment this line
  };
}

// optional properties
{
  interface Person {
    name: string;
    age?: number;
  }

  let tom: Person = {
    name: "Tom",
  };

  let jerry: Person = {
    name: "Jerry",
    age: 25,
    // gender: "male",
  };
}

// any properties
{
  interface Person {
    name: string;
    age?: number;
    [propName: string]: any;
  }

  let tom: Person = {
    name: "Tom",
    gender: true,
  };

  let jerry: Person = {
    name: "Jerry",
    age: 25,
    gender: false,
  };
}

{
  interface Person {
    name: string;
    age: number;
    [prop: string]: string | number;
  }

  let tom: Person = {
    name: "Tom",
    age: 25,
    gender: "male",
  };

  let jerry: Person = {
    name: "Jerry",
    age: 25,
    gender: 1,
  };
}

// readonly properties
{
  interface Person {
    readonly id: number;
    name: string;
    age?: number;
    [propName: string]: any;
  }

  let tom: Person = {
    id: 123,
    name: "Tom",
    gender: "male",
  };

  // tom.id = 89757;
}
